<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title></title>
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="/public/js/ace/css/bootstrap.css" />
    <link rel="stylesheet" href="/public/js/ace/css/font-awesome.css" />
    <!-- page specific plugin styles -->
    <!-- text fonts -->
    <link rel="stylesheet" href="/public/js/ace/css/ace-fonts.css" />
    <!-- ace styles -->
    <link rel="stylesheet" href="/public/js/ace/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />
    <!--[if lte IE 9]>
    <link rel="stylesheet" href="/public/js/ace/css/ace-part2.css" class="ace-main-stylesheet" />
    <![endif]-->
    <!--[if lte IE 9]>
    <link rel="stylesheet" href="/public/js/ace/css/ace-ie.css" />
    <![endif]-->
    <!-- inline styles related to this page -->
    <!-- ace settings handler -->
    <script src="/public/js/ace/js/ace-extra.js"></script>
    <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->
    <!--[if lte IE 8] -->
    <script src="/public/js/ace/js/html5shiv.js"></script>
    <script src="/public/js/ace/js/respond.js"></script>

</head>
<body class="no-skin">

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <form action="workflow/process/upload/" name="Form" id="Form" method="post" enctype="multipart/form-data">
                            <div id="zhongxin">
                                <table style="width:95%;" >
                                    <tr>
                                        <td style="padding-top: 20px;"><input type="file" id="zip" name="zip" style="width:50px;" onchange="fileType(this)" /></td>
                                    </tr>
                                    <tr>
                                        <td style="padding-top: 20px;text-align: center;">
                                            <p class="text-warning bigger-110 orange" style="padding-top: 5px;">注意：压缩包中不能包含目录</p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center;padding-top: 10px;">
                                            <a class="btn btn-mini btn-primary" onclick="save();">导入</a>
                                            <a class="btn btn-mini btn-danger" onclick="onClose()">取消</a>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div id="zhongxin2" class="center" style="display:none"><br/><img src="public/images/jzx.gif" /><br/><h4 class="lighter block green"></h4></div>
                        </form>
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content -->
        </div>
    </div>
    <!-- /.main-content -->
</div>
<!-- /.main-container -->
<!--[if !IE]> -->
<script type="text/javascript">
    window.jQuery || document.write("<script src='<%=basePath%>public/js/ace/js/jquery.js'>"+"<"+"/script>");
</script>
<!-- <![endif]-->
<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='<%=basePath%>public/js/ace/js/jquery1x.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
    if('ontouchstart' in document.documentElement) document.write("<script src='<%=basePath%>public/js/ace/js/jquery.mobile.custom.js'>"+"<"+"/script>");
</script>
<script src="public/js/ace/js/bootstrap.js"></script>
<!-- basic scripts -->
<!-- ace scripts -->
<script src="public/js/ace/js/ace/ace.js"></script>
<!-- 上传控件 -->
<script src="public/js/ace/js/ace/elements.fileinput.js"></script>
<!--提示框-->
<script type="text/javascript" src="public/js/jquery.tips.js"></script>
<script type="text/javascript">
    var frameIndex = parent.layer.getFrameIndex(window.name);
    $(function() {
        //上传
        $('#zip').ace_file_input({
            no_file:'请选择zip ...',
            btn_choose:'选择',
            btn_change:'更改',
            droppable:false,
            onchange:null,
            thumbnail:false, //| true | large
            whitelist:'zip',
            blacklist:'zip'
        });
    });

    //保存
    function save(){
        if($("#zip").val()=="" || document.getElementById("zip").files[0] =='请选择zip格式的文件'){
            $("#zip").tips({
                side:3,
                msg:'请选择文件',
                bg:'#AE81FF',
                time:3
            });
            return false;
        }
        $("#Form").submit();
    }
    function fileType(obj){
        var fileType=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名
        if(fileType != '.zip'){
            $("#zip").tips({
                side:3,
                msg:'请上传zip格式的文件',
                bg:'#AE81FF',
                time:3
            });
            $("#zip").val('');
            document.getElementById("zip").files[0] = '请选择zip格式的文件';
        }
    }
    function onClose(){
        parent.layer.msg('用户已取消', {
            time: 1200 //20s后自动关闭
        });
        parent.layer.close(frameIndex);
    }
</script>
</body>
</html>